All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.naming.directory.InitialDSContext

java.lang.Object
   |
   +----java.naming.InitialContext
           |
           +----java.naming.directory.InitialDSContext

public class InitialDSContext
extends InitialContext
implements DSContext
The InitialDSContext is the starting point for performing directory operations.

See Also:
InitialContext

Variable Index

 o defaultInitDSCtx

Constructor Index

 o InitialDSContext()
Constructs an initial DSContext.
 o InitialDSContext(Properties)
Constructs an initial DSContext using information supplied in 'environment'.

Method Index

 o bind(Name, Object, AttributeSet)
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object.
 o bind(String, Object, AttributeSet)
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object.
 o createSubcontext(Name, AttributeSet)
Creates a new subcontext with the given name resolved relative to the initial context, and associates the attributes 'attrs' with the named object.
 o createSubcontext(String, AttributeSet)
Creates a new subcontext with the given name resolved relative to the initial context, and associates the attributes 'attrs' with the named object.
 o getAttributes(Name)
Retrieves all the attributes associated with named object.
 o getAttributes(Name, String[])
Retrieves the attributes listed in attrIds associated with named object.
 o getAttributes(String)
Retrieves all the attributes associated with named object.
 o getAttributes(String, String[])
Retrieves the attributes listed in attrIds associated with named object.
 o getSchema(Name)
Retrieves the schema associated with this initial DSContext.
 o getSchema(String)
Retrieves the schema associated with this initial DSContext.
 o getSchemaClassDefinition(Name)
Retrieves the schema class definition associated with this initial context.
 o getSchemaClassDefinition(String)
Retrieves the schema class definition associated with this initial context.
 o modifyAttributes(Name, int, AttributeSet)
Modifies according to mod_op and attrs the attributes associated with the named object.
 o modifyAttributes(Name, ModificationEnumeration)
Modifies according to mods the attributes associated with the named object.
 o modifyAttributes(String, int, AttributeSet)
Modifies according to mod_op and attrs the attributes associated with the named object.
 o modifyAttributes(String, ModificationEnumeration)
Modifies according to mods the attributes associated with the named object.
 o rebind(Name, Object, AttributeSet)
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object.
 o rebind(String, Object, AttributeSet)
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object.
 o search(Name, AttributeSet)
Searches for named objects that contain a set of attributes in a single context.
 o search(Name, AttributeSet, String[])
Searches for named objects that contain a set of attributes in a single context.
 o search(Name, String, Object[], SearchConstraints)
Search in the context named by 'name' entries with that satisfies the given 'filter'.
 o search(Name, String, SearchConstraints)
Search in the context named by 'name' entries with that satisfies the given string 'filter'.
 o search(String, AttributeSet)
Searches for named objects that contain a set of attributes in a single context.
 o search(String, AttributeSet, String[])
Searches for named objects that contain a set of attributes in a single context.
 o search(String, String, Object[], SearchConstraints)
Search in the context named by 'name' entries with that satisfies the given 'filter'.
 o search(String, String, SearchConstraints)
Search in the context named by 'name' entries with that satisfies the given string 'filter'.

Variables

 o defaultInitDSCtx
 protected DSContext defaultInitDSCtx

Constructors

 o InitialDSContext
 public InitialDSContext()
Constructs an initial DSContext.

 o InitialDSContext
 public InitialDSContext(Properties environment)
Constructs an initial DSContext using information supplied in 'environment'.

Parameters:
environment - Environment properties that may be used in the construction of the initial DSContext (such as user name, password, etc.)

Methods

 o getAttributes
 public AttributeSet getAttributes(String name) throws NamingException
Retrieves all the attributes associated with named object.

Parameters:
name - The string name of the object for which to retrieve the attributes. name is resolved relative to the initial context.
Returns:
The attributes associated with 'name'.
 o getAttributes
 public AttributeSet getAttributes(String name,
                                   String attrIds[]) throws NamingException
Retrieves the attributes listed in attrIds associated with named object.

Parameters:
name - The string name of the object for which to retrieve the attributes. name is resolved relative to the initial context.
attrIds - The attribute ids of the attributes to retrieve.
Returns:
The attributes identified by attrIds (or a subset thereof if some attributes are not found).
 o getAttributes
 public AttributeSet getAttributes(Name name) throws NamingException
Retrieves all the attributes associated with named object.

Parameters:
name - The name of the object for which to retrieve the attributes. name is resolved relative to the initial context.
Returns:
The attributes associated with 'name'.
 o getAttributes
 public AttributeSet getAttributes(Name name,
                                   String attrIds[]) throws NamingException
Retrieves the attributes listed in attrIds associated with named object.

Parameters:
name - The name of the object for which to retrieve the attributes. name is resolved relative to the initial context.
attrIds - The attribute ids of the attributes to retrieve.
Returns:
The attributes identified by attrIds (or a subset thereof if some attributes are not found).
 o modifyAttributes
 public void modifyAttributes(String name,
                              int mod_op,
                              AttributeSet attrs) throws NamingException
Modifies according to mod_op and attrs the attributes associated with the named object. The order of the modifications within attrs are not specified. Where possible, the modifications are performed atomically. If the operation fails to complete, AttributeModification is thrown containing details of the failure.

Parameters:
name - The string name of the object whose attributes will be updated. name is resolved relative to the initial context.
mod_op - The modification operation. It is one of ADD_ATTRIBUTE, REPLACE_ATTRIBUTE, DELETE_ATTRIBUTE.
attrs - The attributes to use for the modification.
 o modifyAttributes
 public void modifyAttributes(Name name,
                              int mod_op,
                              AttributeSet attrs) throws NamingException
Modifies according to mod_op and attrs the attributes associated with the named object. The order of the modifications within attrs are not specified. Where possible, the modifications are performed atomically. If the operation fails to complete, AttributeModification is thrown containing details of the failure.

Parameters:
name - The name of the object whose attributes will be updated. name is resolved relative to the initial context.
attrs - The attributes to use for the modification.
mod_op - The modification code.
 o modifyAttributes
 public void modifyAttributes(String name,
                              ModificationEnumeration mods) throws NamingException
Modifies according to mods the attributes associated with the named object. Where possible, the modifications are performed atomically. If the operation fails to complete, AttributeModification is thrown containing details of the failure.

Parameters:
name - The string name of the object whose attributes will be updated. name is resolved relative to the initial context.
mods - The list of modifications to apply.
 o modifyAttributes
 public void modifyAttributes(Name name,
                              ModificationEnumeration mods) throws NamingException
Modifies according to mods the attributes associated with the named object. Where possible, the modifications are performed atomically. If the operation fails to complete, AttributeModification is thrown containing details of the failure.

Parameters:
name - The name of the object whose attributes will be updated. name is resolved relative to the initial context.
mods - The list of modifications to apply.
 o bind
 public void bind(String name,
                  Object obj,
                  AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object. If 'attrs' is null, the resulting binding will have the attributes associated with 'obj' if 'obj' is a DSContext. If 'obj' is not a DSContext and 'attrs' is null, the resulting binding will have no attributes. If 'attrs' is non-null, the resulting binding will have 'attrs' as its attributes and any attributes associated with 'obj' are ignored.

Parameters:
name - The name to bind, resolved relative to the initial context. It cannot be empty.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If the attributes specified by 'attrs', or 'obj' if 'attrs' is null, are not sufficient to create the binding.
 o bind
 public void bind(Name name,
                  Object obj,
                  AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associate the attributes 'attrs' with the named object. If 'attrs' is null, the resulting binding will have the attributes associated with 'obj' if 'obj' is a DSContext. If 'obj' is not a DSContext and 'attrs' is null, the resulting binding will have no attributes. If 'attrs' is non-null, the resulting binding will have 'attrs' as its attributes and any attributes associated with 'obj' are ignored.

Parameters:
name - The name to bind, resolved relative to the initial context. It cannot be empty.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If the attributes specified by 'attrs', or 'obj' if 'attrs' is null, are not sufficient to create the binding.
 o rebind
 public void rebind(String name,
                    Object obj,
                    AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object. If 'name' is already bound, 'obj' overwrites the existing binding. If 'attrs' is null and 'obj' is a DSContext, the attributes from 'obj' are used. If 'attrs' is null and 'obj' is not a DSContext, any existing attributes associated with the already bound object remain unchanged. If 'attrs' is non-null, any existing attributes associated with the already bound object are removed and 'attrs' is associated with the named object. If 'obj' is a DSContext and 'attrs' is non-null, obj's attributes are ignored.

Parameters:
name - The name to bind, resolved relative to the initial context.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
 o rebind
 public void rebind(Name name,
                    Object obj,
                    AttributeSet attrs) throws NamingException
Binds 'name' to the object 'obj' and associates the attributes 'attrs' with the named object. If 'name' is already bound, 'obj' overwrites the existing binding. If 'attrs' is null and 'obj' is a DSContext, the attributes from 'obj' are used. If 'attrs' is null and 'obj' is not a DSContext, any existing attributes associated with the already bound object remain unchanged. If 'attrs' is non-null, any existing attributes associated with the already bound object are removed and 'attrs' is associated with the named object. If 'obj' is a DSContext and 'attrs' is non-null, obj's attributes are ignored.

Parameters:
name - The name to bind, resolved relative to the initial context.
obj - The object to bind.
attrs - The attributes to associate with the bound object.
 o createSubcontext
 public DSContext createSubcontext(String name,
                                   AttributeSet attrs) throws NamingException
Creates a new subcontext with the given name resolved relative to the initial context, and associates the attributes 'attrs' with the named object. If 'name' is already bound, throws NameAlreadyBoundException.

Parameters:
name - The string name to use when creating the new context. name is resolved relative to the initial context.
attrs - The attributes to associate with the newly created context.
Returns:
The newly created context.
Throws: NameAlreadyBoundException
name is already bound.
Throws: InvalidAttributeSetException
If 'attrs' does not contain all the mandatory attributes required for creation.
 o createSubcontext
 public DSContext createSubcontext(Name name,
                                   AttributeSet attrs) throws NamingException
Creates a new subcontext with the given name resolved relative to the initial context, and associates the attributes 'attrs' with the named object.

Parameters:
name - The name to use when creating the new context. name is resolved relative to the initial context.
attrs - The attributes to associate with the newly created context.
Returns:
The newly created context.
Throws: NameAlreadyBoundException
If name is already bound.
Throws: InvalidAttributeSetException
If 'attrs' does not contain all the mandatory attributes required for creation.
 o getSchema
 public DSContext getSchema(String name) throws NamingException
Retrieves the schema associated with this initial DSContext.

Parameters:
name - name of context.
Returns:
The schema associated with this initial DSContext.
 o getSchema
 public DSContext getSchema(Name name) throws NamingException
Retrieves the schema associated with this initial DSContext.

Parameters:
name - name of context.
Returns:
The schema associated with this initial DSContext.
 o getSchemaClassDefinition
 public DSContext getSchemaClassDefinition(String name) throws NamingException
Retrieves the schema class definition associated with this initial context.

Returns:
The schema class definition associated with this initial context.
 o getSchemaClassDefinition
 public DSContext getSchemaClassDefinition(Name name) throws NamingException
Retrieves the schema class definition associated with this initial context.

Returns:
The schema class definition associated with this initial context.
 o search
 public SearchEnumeration search(String name,
                                 AttributeSet matchingAttributes) throws NamingException
Searches for named objects that contain a set of attributes in a single context.

Parameters:
name - The string name of the context to search. name is resolved relative to the initial context.
matchingAttributes - The attributes to search for.
Returns:
An enumeration of the objects that has the attributes specified in matchingAttributes. All attributes associated with the named object are returned.
 o search
 public SearchEnumeration search(Name name,
                                 AttributeSet matchingAttributes) throws NamingException
Searches for named objects that contain a set of attributes in a single context.

Parameters:
name - The name of the context to search. name is resolved relative to the initial context.
matchingAttributes - The attributes to search for.
Returns:
An enumeration of the objects that has the attributes specified in matchingAttributes. All attributes associated with the named object are returned.
 o search
 public SearchEnumeration search(String name,
                                 AttributeSet matchingAttributes,
                                 String attributesToReturn[]) throws NamingException
Searches for named objects that contain a set of attributes in a single context.

Parameters:
name - The name of the context to search. name is resolved relative to the initial context.
matchingAttributes - The attributes to search for.
attributesToReturn - The attributes to return.
Returns:
An enumeration of the objects that has the attributes specified in matchingAttributes. Each item in the enumeration contain the attributes identified by attributesToReturn.
 o search
 public SearchEnumeration search(Name name,
                                 AttributeSet matchingAttributes,
                                 String attributesToReturn[]) throws NamingException
Searches for named objects that contain a set of attributes in a single context.

Parameters:
name - The name of the context to search. name is resolved relative to the initial context.
matchingAttributes - The attributes to search for.
attributesToReturn - The attributes to return.
Returns:
An enumeration of the objects that has the attributes specified in matchingAttributes. Each item in the enumeration contain the attributes identified by attributesToReturn.
 o search
 public SearchEnumeration search(String name,
                                 String filter,
                                 SearchConstraints cons) throws NamingException
Search in the context named by 'name' entries with that satisfies the given string 'filter'. Perform the search according to parameters specified in the search constraints 'cons'.

Parameters:
name - The string name of the context/object to start the search. name is resolved relative to the initial context.
filter - The string filter to use for the search. The syntax used for the filter is the LDAP filter syntax (RFC 1960).
cons - The search constraints to be applied to this search.
Returns:
An enumeration of the objects that satifised the filter.
 o search
 public SearchEnumeration search(Name name,
                                 String filter,
                                 SearchConstraints cons) throws NamingException
Search in the context named by 'name' entries with that satisfies the given string 'filter'. Perform the search according to parameters specified in the search constraints 'cons'.

Parameters:
name - The name of the context/object to start the search. name is resolved relative to the initial context.
filter - The string filter to use for the search. The syntax used for the filter is the LDAP filter syntax (RFC 1960).
cons - The search constraints to be applied to this search.
Returns:
An enumeration of the objects that satifised the filter.
 o search
 public SearchEnumeration search(String name,
                                 String filterExpr,
                                 Object filterArgs[],
                                 SearchConstraints cons) throws NamingException
Search in the context named by 'name' entries with that satisfies the given 'filter'. Perform the search according to parameters specified in the search constraints 'cons'.

Parameters:
name - The string name of the context/object to start the search. name is resolved relative to the initial context.
filter - The filter to use for the search.
cons - The search constraints to be applied to this search.
Returns:
An enumeration of the objects that satifised the filter.
 o search
 public SearchEnumeration search(Name name,
                                 String filterExpr,
                                 Object filterArgs[],
                                 SearchConstraints cons) throws NamingException
Search in the context named by 'name' entries with that satisfies the given 'filter'. Perform the search according to parameters specified in the search constraints 'cons'.

Parameters:
name - The name of the context/object to start the search. name is resolved relative to the initial context.
filter - The filter to use for the search.
cons - The search constraints to be applied to this search.
Returns:
An enumeration of the objects that satifised the filter.

All Packages  Class Hierarchy  This Package  Previous  Next  Index